<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.lmpop.trade.openFlashChart.Graph"%>
<%@ page import="com.lmpop.trade.openFlashChart.Bar"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.lmpop.trade.ti_keyword.*" %>
<%@page import="java.util.Hashtable"%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>seller</title>
</head>
<body>
<%
	String key = "";
	String iStart = "0";
	int limit = 10;
	Hashtable ti_keyword = new Hashtable();
	Ti_keywordInfo ti_keywordInfo = new Ti_keywordInfo();
	String k_type = "1";
	ti_keyword.put("key_type",k_type);
	
	List keylist = ti_keywordInfo.getListByPage(ti_keyword,Integer.parseInt(iStart),limit);	
	
	Graph g = new Graph();
	Bar b = new Bar("50", "#9933CC");
	b.setVar("bar_3d");
	//b.setVar("bar_glass");
	//b.setVar("bar_fade");
	//Bar b2 = new Bar("50", "#0000FF");
	//b2.setVar("bar_3d");
	//b2.setVar("bar_glass");
	//b2.setVar("bar_fade");
	//b.key("page views", 15);
	//b2.key("Bounces", 15);
	
	
	List<String> labels = new ArrayList<String>();
	
	//labels.add("十一月");
	//labels.add("十二月");
	
	if(keylist.size() < 10){
		if(keylist != null && keylist.size() > 0){
			Hashtable keymap = new Hashtable();
			String key_word = "",location = "";		
			int fu_klist = keylist.size()/10;
			int keylist_no = keylist.size()%10;
			int listsize = keylist.size();
	
			for(int i = 0; i < 10 && i < keylist_no; i++){
				keymap = (Hashtable)keylist.get(i);
				if(keymap.get("key_word") != null)key_word = keymap.get("key_word").toString();
				if(keymap.get("location") != null)location = keymap.get("location").toString();
			
				b.add(location,"#");
				labels.add(key_word);
				
				
			}
			
			if(keylist_no < 10){
				int j = 10 - keylist_no;
				for(int k = 0;k < j;k++){
					labels.add(" ");
				}
			}
		}else{
			b.add("","#");
			labels.add("");
		}
	}else{
		if(keylist != null && keylist.size() > 0){
			Hashtable keymap = new Hashtable();
			String key_word = "",location = "";
			int fu_klist = keylist.size()/10;
			int keylist_no = keylist.size()%10;
			for(int m = 0; m <= fu_klist; m++){
				if(m == fu_klist){
				
			}else{
				for(int i = 0; i < 10 && i < keylist.size(); i++) {
				    out.println("keylist de size 是"+keylist.size());
					keymap = (Hashtable)keylist.get(i);
					if(keymap.get("key_word") != null)key_word = keymap.get("key_word").toString();
					if(keymap.get("location") != null)location = keymap.get("location").toString();
					
					b.add(location,"#");
					labels.add(key_word);
				}
				if(keylist_no < 10 && keylist_no > 0){
					int j = 10 - keylist_no;
					for(int k = 0;k < j;k++){
						labels.add(" ");
					}
				}
			}
		}
		}else{
			b.add("","#");
			labels.add("");
		}
	}
	// Spoon sales, March 2007
	
	g.title("卖家-关键字统计图", "{font-size: 26px;}");
	
	g.getData_sets().add(b);
	//g.getData_sets().add(b2);
	g.bar_3D("75", "#D54C78", "2010", 8);
	g.bar_3D("75", "#3334AD", "2011", 8);
	
	//g.bar_glass("75", "#D54C78", "");
	//g.bar_glass("75", "#D54C78", "");
	
	//g.bar_fade("75");
	//g.bar_fade("75");
	
	// label each point with its value
	
	g.set_x_labels(labels);
	g.set_x_label_style("10", "#9933CC", 0, 0, "");
	//g.set_x_legend("Open Flash Chart Demo", 10, "#736AFF");
	g.set_x_axis_3d(5);
	
	g.x_axis_colour("#909090", "#ADB5C7");
	g.x_axis_colour("#909090", "#ADB5C7");
	
	int y_max = ti_keywordInfo.getYMaxByType("1");
	
	g.set_y_max(y_max);
	g.y_label_steps(10);
%>
<%=g.render()%>
</body>
</html>